#!/bin/bash
#update kata to support hygon feature

tar -C /usr/local -xvf go1.16.10.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
tar -xvf kata-2.5.2.tar.gz
cd kata-containers-2.5.2
patch -p1</opt/hygon/csv/kata.patch
cd src/runtime
PREFIX=/opt/kata make
PREFIX=/opt/kata make install
mkdir -p /etc/containerd/
mkdir -p /etc/kata-containers/
cp -f /opt/kata/share/defaults/kata-containers/configuration.toml /etc/kata-containers/configuration.toml
cp -f  /opt/hygon/csv/config.toml /etc/containerd/config.toml
